package com.raccoonagents.tools.cascet2d.model.components;

import org.lwjgl.opengl.GL11;

import com.raccoonagents.tools.cascet2d.interfaces.IRenderableStageElement;
import com.raccoonagents.tools.cascet2d.model.Text;
import com.raccoonagents.tools.cascet2d.model.Vector2f;
public class Label extends AbstractStageUIComponent{

	
	private Text title;
	
	public Text getTitle() {
		return title;
	}
	public void setTitle(final String title) {
		this.title.setText(title);
	}
	public Label(final IRenderableStageElement parent){
		this.parent = parent;
	}
	public Label(final IRenderableStageElement parent, final String title) {
		this.parent = parent;
		this.title = new Text(title);
	}
	@Override
	public void render() {
		if(!visible){
			return;
		}
		GL11.glPushMatrix();
		GL11.glTranslatef(localLocation.x, localLocation.y, 0);
		title.render();
		GL11.glPopMatrix();
	}
	
	@Override
	public Vector2f getSize() {
		return title.getSize();
	}
	@Override
	public float[] getColor() {
		return new float []{1.0f,1.0f,1.0f};
	}
	@Override
	public float getOpacity() {
		return 1.0f;
	}
	@Override
	public float getRotation() {
		return 0;
	}
	
}
